# 1 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i"
;cpredorxy8i

;2d REDOR  experiment 
;Rance & Byrd phase cycling for the echo
;see: Gullion & Schaefer, J.M.R., 81, 196, 1989

;interleaved xy8 acquisition of Sr and So signal
;written by jos (06/06/04)
;updated JOS 07/06/06
;updated for 1 JOS 10/25/07
# 12 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i"
;parameters:
;p3 : proton 90 at power level pl12
;p15 : contact time at pl1 (f1) and pl2 (f2)
;cpdprg2 : cw, tppm (at pl12), 
;p2 : X 180 degree pulse at pl11
;p12 : Y 180 degree pulse at pl3
;p31 : TPPM pulse length
;cnst31 : spin rate >1 kHz
;l0 : number loops of xy8
;d1 : recycle delay
;d31 : used to check spin rate
;pl1 : X power level for contact
;pl11 : X power level for 180
;pl2 : proton power level for contact
;pl12 : proton power level for decoupling
;pl3 : Y power level for 180 pulse
;pl22 : =119 dB (no recoupling pulses) (S0 signal)
;pl13 : e.g. used in tppm13
;spnam0 : file name for variable amplitude CP

;$COMMENT=REDOR experiment, cp for excitation, XY8 phase cycle
;$CLASS=Solids
;$DIM=pseudo 2D
;$TYPE=cross polarisation
;$SUBTYPE=interleaved REDOR 

# 1 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Avancesolids.incl" 1
;Avancesolids.incl
;   for TCU3
;
;version 1 28.2.2001, written by HF
;	   4.4.2006, complemented by Ste

;$CLASS=Solids INCL
;$COMMENT=definitions for setrtp and setnmr

;switch between 1H or 19F output (H amplifier) 
# 14 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Avancesolids.incl"
;gating pulse for RX, ADC and HPPR auto mode


# 18 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Avancesolids.incl"
;explicit blanking of preamp, receiver, adc, not implemented yet


# 26 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Avancesolids.incl"
;generate dwell clock


;turn dwell clock on/off
# 32 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Avancesolids.incl"
;


# 36 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Avancesolids.incl"
;define data sampling for WAHUHA type experiments, samples analogue or digitally for d9, closes receiver


# 40 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/Avancesolids.incl"
;explicit transmitter blanking, not supported yet

;NCO switching, to be implemented

;$Id: Avancesolids.incl,v 1.8.2.1 2017/02/22 17:02:01 ber Exp $
# 40 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i" 2
# 41 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i"
"l1=l0*8"
"d25=0.25s/cnst31"
"d26=0.25s/cnst31-(p12/2)"	; one-quarter rotor cycle ...
"d27=0.25s/cnst31-(p2/2)"	; ... with various corrections
"d29=0.75s/cnst31-(p2/2)"
"d31=1s/cnst31"
define loopcounter nfid
"nfid=td1/2"
define delay dephase
"dephase = (d31*2)+(d31*l1)"
define delay totaldephase
"totaldephase=(d31*2)+(d31*l1)+((nfid-1)*l3*l1*d31)"
"acqt0=1u*cnst11"
  

# 1 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/trigg.incl" 1
;version (13/08/19)

;$COMMENT=definition of external trigger output, conn I pin 1
;$CLASS=Solids INCL
# 12 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/trigg.incl"
;$Id: 6u setnmr3|28 \n              4u  setnmr3^28.incl,v 1.6.2.1 2013/08/29 14:03:54 ber Exp $
# 56 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i" 2


# 1 "mc_line 58 file /opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i dc-measurement inserted automatically"

    dccorr
# 58 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i"
1 ze			;accumulate into an empty memory
  dephase
  totaldephase
# 1 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/rot_prot.incl" 1
;rot_prot.incl
;avance-version (13/01/29)
;Test the rf on-time and duty cycle
;protect against misset cnst31, rotation speed below 1000 Hz
;
;$CLASS=Solids INCL
;$COMMENT=protect against misset cnst31, rotation speed below 1000 Hz


1m
if "d31 < 1m" goto Passrot
2u
print "rotation period too long, cnst31 misset to less than 1000 Hz!"
goto HaltAcqu
Passrot, 1m
# 19 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/rot_prot.incl"
;$Id: rot_prot.incl,v 1.8 2013/01/29 15:40:14 ber Exp $
# 62 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i" 2

# 1 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/p15_prot.incl" 1
;p15_prot.incl
;avance-version (13/01/29)
;Test the rf on-time and duty cycle
;protect against too long contact time
;Test the rf on-time and duty cycle 
;
;$CLASS=Solids INCL
;$COMMENT=protect against too long contact time

# 11 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/p15_prot.incl"
1m
if "p15 < 10.1m" goto Passp15
2u
print "contact time exceeds 10msec limit!"
goto HaltAcqu
Passp15, 1m


# 20 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/p15_prot.incl"
;$Id: p15_prot.incl,v 1.8 2013/01/29 15:40:14 ber Exp $
# 63 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i" 2

# 1 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/aq_prot.incl" 1
;aq_prot.incl
;avance-version (13/01/28)
;Test the rf on-time and duty cycle
;protect against too long acquisition time

;$CLASS=Solids INCL
;$COMMENT=protect against too long acquisition time
# 9 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/aq_prot.incl"
1m
if "aq < 50.1m" goto Passaq
2u 
print "acquisition time exceeds 50m limit!"
goto HaltAcqu
Passaq, 1m

;$Id: aq_prot.incl,v 1.8 2013/01/28 17:39:02 ber Exp $
# 64 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i" 2
2 d1 do:f2		;recycle delay, decoupler off in go-loop
  "l1=l0*8" 
  10u pl1:f1                  	;set power level to drive HP amplifier
  10u pl12:f2                  	;set decoupler power
  10u pl3:f3
  rpp8	       	              	; reset phase list ph8 ...
  rpp9		              	;          ... and ph9
  6u setnmr3|28 \n              4u  setnmr3^28
  p3:f2 ph1                   	;90 degree proton pulse
  0.5u
  (p15 ph2):f1 (p15:sp0 ph3):f2   	;cross-polarization
   d25 cpds2:f2  		; tppm decoupling at pl12
3  d26 pl11:f1			; several F3 pulses ...
  (p12 ph8^):f3       		; ... at intervals of ...
   d26				; ... one-half rotor cycle
   d27
  (p2 ph9^):f1	        	; F1 pulse
   d27
lo to 3 times l1 
  d29
  (p2 ph2):f1           	; Hahn echo refocussing pulse
  d29
  d25			      	; Hahn echo occurs about now
  go=2 ph31 
  1m do:f2
  30m wr #0 if #0 zd		; write S 
  1u				; this delay equalizes loop inc.

12 d1 do:f2		;recycle delay, decoupler off in go-loop
  "l1=l0*8" 
  10u pl1:f1                  	;set power level to drive HP amplifier
  10u pl12:f2                  	;set decoupler power
  10u pl22:f3
  rpp8	       	              	; reset phase list ph8 ...
  rpp9		              	;          ... and ph9
  6u setnmr3|28 \n              4u  setnmr3^28                       	;additional trigger available on HP router
  p3:f2 ph1                   	;90 degree proton pulse
0.5u
  (p15 ph2):f1 (p15:sp0 ph3):f2   	;cross-polarization
   d25 cpds2:f2  		; tppm decoupling at pl12
13  d26 pl11:f1			; several F3 pulses ...
  (p12 ph8^):f3       		; ... at intervals of ...
   d26				; ... one-half rotor cycle
   d27
  (p2 ph9^):f1	        	; F1 pulse
   d27
lo to 13 times l1 
  d29
  (p2 ph2):f1           	; Hahn echo refocussing pulse
  d29
  d25			      	; Hahn echo occurs about now
  go=12 ph31 
  1m do:f2
  30m wr #0 if #0 zd		; write S0
# 119 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i"
30  1u iu0
   lo to 30 times l3
lo to 2 times nfid
HaltAcqu, 1m
exit

ph1=  1 1 3 3
ph2=  0 1 0 1
ph3=  0
ph8=  0 1 0 1  1 0 1 0
ph9=  0 1 0 1  1 0 1 0
ph31= 0 1 2 3

# 134 "/opt/topspin3.7.0/exp/stan/nmr/lists/pp/cpredorxy8i"
;$Id: cpredorxy8i,v 1.1 2018/01/12 16:08:12 ber Exp $
